#include <stdio.h>

void main()
{
	char *s="That's good news";   
    int i=617;   
    FILE *fp;  
    fp=fopen("write.txt", "w+"); /*建立一个文字文件只写*/   
    fputs("Your score of TOEFL is",fp); /*向所建文件写入一串字符*/   
    fputc(':', fp); /*向所建文件写冒号:*/   
    fprintf(fp, "%d\n", i); /*向所建文件写一整型数*/   
    fprintf(fp, "%s", s); /*向所建文件写一字符串*/   
    fclose(fp);
}

void read(){
	FILE *fp;
	char str[128];
	system("cls");
	if((fp=fopen("dump.txt","r"))==NULL) {  
        printf("cannot open file/n"); exit(1);  
    }
	while(!feof(fp)) {  
        if(fgets(str,128,fp)!=NULL)  
        printf("%s",str);  
    }  
    fclose(fp);
}